package com.px.service.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.px.common.annotation.Excel;
import com.px.common.core.domain.BaseEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * 亲属关系字典对象 t_relationship
 *
 * @author 品讯科技
 * @date 2024-08
 */
public class Relationship extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 名称
     */
    @Excel(name = "名称")
    private String name;

    /**
     * 父节点id
     */
    @Excel(name = "父节点id")
    private Long parentId;

    /**
     * 级别
     */
    @Excel(name = "级别")
    private Long level;

    /**
     * 排序
     */
    @Excel(name = "排序")
    private Long sort;

    /**
     * 状态（0-正常，-1-禁用）
     */
    @Excel(name = "状态", readConverterExp = "0=正常,-1=禁用")
    private Long status;

    /**
     * 子集
     */
    private List<Relationship> children;

    public List<Relationship> getChildren() {
        if (children == null) {
            return new ArrayList<>();
        }
        return children;
    }

    public void setChildren(List<Relationship> children) {
        this.children = children;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setLevel(Long level) {
        this.level = level;
    }

    public Long getLevel() {
        return level;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public Long getSort() {
        return sort;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public Long getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("parentId", getParentId())
                .append("level", getLevel())
                .append("sort", getSort())
                .append("status", getStatus())
                .toString();
    }
}
